package com.alibaba.algo.apiimpl.feign;

import com.alibaba.algo.Application;
import com.alibaba.algo.cooperation.common.BaseResult;
import com.alibaba.algo.cooperation.feign.vo.req.GetUserOrgsReqVO;
import com.alibaba.algo.cooperation.feign.vo.res.UserOrgInfoResVO;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.List;

/**
 * @author : WangZhiPan
 * @date : 2021/10/26 10:23
 */
@SpringBootTest(classes = Application.class)
@RunWith(SpringRunner.class)
@Slf4j
public class UserFeignServiceImplTest {


    @Autowired
    private UserFeignServiceImpl userFeignService;


    @Test
    public void getOrgsByUserTest() {
        GetUserOrgsReqVO vo = GetUserOrgsReqVO.builder()
                .userId(17801130175L).build();
        BaseResult<List<UserOrgInfoResVO>> resp = userFeignService.getOrgsByUser(vo);
        log.info("resp={}", JSON.toJSONString(resp));
    }
}
